package com.wc.alorithm_blue_bridge._模拟.不完整的算式;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/22 23:54
 * @description https://www.lanqiao.cn/problems/17135/learning/?problem_list_id=32&page=1
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static char[] s;

    public static void main(String[] args) {
        s = (" " + sc.next()).toCharArray();
        int qId = -1, eId = -1, opId = -1;
        int n = s.length - 1;
        for (int i = 1; i <= n; i++) {
            if (s[i] == '?') qId = i;
            if (s[i] == '=') eId = i;
            if (s[i] == '+' || s[i] == '-' || s[i] == '/' || s[i] == '*') opId = i;
        }
        // ? is A
        if (qId == 1) {
            char op = s[opId];
            int b = getX(opId + 1, eId - 1);
            int c = getX(eId + 1, n);
            int a;
            if (op == '+') a = c - b;
            else if (op == '-') a = c + b;
            else if (op == '*') a = c / b;
            else a = c * b;

            out.println(a);
            // ? is B
        } else if (qId == eId - 1) {
            char op = s[opId];
            int a = getX(1, opId - 1);
            int c = getX(eId + 1, n);
            int b;
            if (op == '+') b = c - a;
            else if (op == '-') b = a - c;
            else if (op == '*') b = c / a;
            else b = a / c;

            out.println(b);
            // ? is C
        } else if (qId == eId + 1) {
            char op = s[opId];
            int a = getX(1, opId - 1);
            int b = getX(opId + 1, eId - 1);
            int c;
            if (op == '+') c = a + b;
            else if (op == '-') c = a - b;
            else if (op == '*') c = a * b;
            else c = a / b;
            out.println(c);
            // ? is op
        } else if (opId == -1) {
            int a = getX(1, qId - 1);
            int b = getX(qId + 1, eId - 1);
            int c = getX(eId + 1, n);
            char op;
            if (a + b == c) op = '+';
            else if (a - b == c) op = '-';
            else if (a * b == c) op = '*';
            else op = '/';
            out.println(op);
        }
        out.flush();
    }

    static int getX(int l, int r) {
        int x = 0;
        for (int i = l; i <= r; i++) {
            x = x * 10 + s[i] - '0';
        }
        return x;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
